function myInstanceOf(obj,fn){
    if(typeof obj !=='object'&&typeof obj !=='function'){
        return false
    }
    if(typeof fn !=='function' || !fn.prototype){
        throw new TypeError("Function has non-object prototype 'undefined' in instanceof check")
    }
    let pro = fn.prototype
    while(obj){
        if(pro===obj.__proto__){
            return true
        }
        obj=obj.__proto__
    }
    return false
}
let obj = {}
let a =()=>{}
console.log(a.prototype);
console.log(myInstanceOf(obj,()=>{}));
// obj instanceof a
